const app = getApp();
Page({
  data: {
    theme: app.themeData,
    height: wx.systemInfo.windowHeight,
    isData: false,
  },
  async onLoad(opts) {
    let options = opts || {};
    app.pageOnLoad(this);
    this.setData({
      num: Number(options.num),
      sum: Number(options.sum),
      ...options,
      is_guide: app.ws_micro_shop_globalData.role,
      isData: true,
    }, () => {
      let { is_guide } = this.data;
      let title = Number(is_guide) === -1 ? '设置成功' : '分配结果';
      wx.setNavigationBarTitle({
        title: title,
      });
    });
  },
  onShow() {
    // this.getWeekReport();
  },
  overClick(e) {
    let pages = getCurrentPages();
    let pre_page = pages[pages.length - 2];
    let { url, ...params } = e.currentTarget.dataset;
    url && app.util.navigateTo(url, params, true);
      url || wx.navigateBack({
        delta: 2,
      });
    wx.removeStorageSync('infomation');
  },

  backClick() {
    wx.navigateBack({
      delta: 1,
    });
  },
  collectFormId(e) {
    app.collectFormId(e);
  },
});
